const key = getFilePathStore(import.meta.url)

export const userUserLoginComponentStore = defineStore(key,{
    state: () => ({
        agreementComponetStore:useAgreementComponetStore(),
        footerComponentStore:useFooterComponentStore(),
        coreBaseNavightionStore:useCoreBaseNavightionStore(),
        logoIcon:'/src/assets/logo/logo.jpg'
    }),
    actions:{
        async initStore(){
            await this.footerComponentStore.initStore();
            await this.coreBaseNavightionStore.initStore().then(async(res)=>{
                await res.setTitle('用户登录');
                (await (await res.setHaveLeftIcon(true)).setLeftIconName('revoke')).setLeftArrowClick(()=>{
                    history.go(-1);
                });
                await res.setHaveRightIcon(false);
            });
        }
    },
    persist: {
        key: key,
        storage: sessionStorage
    }
})